% sort of EB Garamond typescript

\definefontfeature
	[eb-garamond-be-normal]
	[default]
	[mode=node,ccmp=yes,calt=yes,
	liga=yes,dlig=yes,hlig=no,
	kern=yes,mark=yes,mkmk=yes,
	onum=yes,pnum=yes,salt=yes,
	script=latn, itlc=yes,
	% cv01=yes, % <- uncomment this to get long s
	protrusion=quality,expansion=quality]
\definefontfeature
	[eb-garamond-be-smallcaps]
	[eb-garamond-be-normal]
	[smcp=yes,c2sc=yes]
\definefontfeature [eb-garamond-be-mathdigits] [lnum=yes]
\starttypescriptcollection[ebgaramond-be]
	\definefontfallback [ebgaramonduprightparenteses] [name:ebgaramondregular] [0x00028:0x00029] [force=yes] % Upright parentheses in italics
	\starttypescript [serif] [ebgaramond-be]
		\loadfontgoodies[ebgaramond]
		\setups[font:fallback:serif]
		\definefontsynonym [Serif] [name:ebgaramondregular] [features=eb-garamond-be-normal]
		\definefontsynonym [SerifItalic] [name:ebgaramonditalic] [features=eb-garamond-be-normal,fallbacks=ebgaramonduprightparenteses]
		\definefontsynonym [SerifBold] [name:ebgaramondbold] [features=eb-garamond-be-normal]
		\definefontsynonym [SerifCaps] [Serif] [features=eb-garamond-be-smallcaps]
	\stoptypescript
	\definefontfallback [ebgaramondmathtext] [name:ebgaramondregular*eb-garamond-be-mathdigits] [digitsnormal] [force=yes]
	\definefontfallback [ebgaramondmathtext] [name:ebgaramondregular] [lowercasenormal] [force=yes]
	\definefontfallback [ebgaramondmathtext] [name:ebgaramondregular] [uppercasenormal] [force=yes]
	\definefontfallback [ebgaramondmathtext] [name:ebgaramonditalic] [lowercasenormal] [offset=lowercaseitalic,force=yes]
	\definefontfallback [ebgaramondmathtext] [name:ebgaramonditalic] [0x00068] [offset=0x0210E,force=yes] % due to some spooky quantum effects lowercase italic math h is located here
	\definefontfallback [ebgaramondmathtext] [name:ebgaramonditalic] [uppercasenormal] [offset=uppercaseitalic,force=yes]
	\starttypescript [math] [ebgaramondandbonum]
		\definefontsynonym [MathRoman] [texgyrebonummath] [features={math,mathextra},fallbacks=ebgaramondmathtext]
	\stoptypescript
	\starttypescript [ebgaramond-be]
		\definetypeface[ebgaramond-be] [rm] [serif] [ebgaramond-be] [default] [designsize=auto] % this breaks italics in smaller sizes and doesn't work well
		\definetypeface[ebgaramond-be] [tt] [mono] [dejavu] [default]
		\definetypeface[ebgaramond-be] [ss] [sans] [adventor] [default]
		\definetypeface[ebgaramond-be] [mm] [math] [ebgaramondandbonum] [default]
	\stoptypescript
\stoptypescriptcollection
